package com.example.chat.controller;

import com.example.chat.pojo.res.ResModel;
import com.example.chat.service.CommonService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 林邵晨
 * @since 2023-07-24
 */
@RestController
@RequestMapping("/chat/common")
public class CommonController {

    @Autowired
    private CommonService commonService;

    @ApiOperation("上传头像")
    @PostMapping(path = "/avatar",produces = "application/json")
    public ResModel upload(MultipartFile file){
        return commonService.upload(file);
    }
}
